package org.lk.common.factory;

import org.lk.common.factory.impl.MysqlStreamReader;

/**
 * @author: lk
 * @since:
 */
public enum DsTypeStrategy {
    MYSQL("mysql", MysqlStreamReader.class);


    private final String type;

    private final Class zClass;

    DsTypeStrategy(String type, Class zClass) {
        this.type = type;
        this.zClass = zClass;
    }


    public static Class getZClass(String type) {
        for (DsTypeStrategy value : DsTypeStrategy.values()) {
            if (value.type.equalsIgnoreCase(type)) {
                return value.zClass;
            }
        }
        throw new IllegalArgumentException("参数异常");
    }
}
